import 'package:basic_common/app_theme.dart';
import 'package:basic_common/common_exports.dart';
import 'package:basic_services/model/server_weight_detail_data.dart';
import 'package:basic_services/serviceDetail/service_detail_controller.dart';
import 'package:basic_widgets/button_widget.dart';
import 'package:basic_widgets/text_widget.dart';

class WeightInfoView extends GetView<ServerDetailController> {
  ServerWeightDetailData detailData;
  WeightInfoView({required this.detailData});
  @override
  Widget build(BuildContext context) {
    List<SriList> list = detailData.sriList!;
    SriList? srLiiData;
    if (list.isNotEmpty) {
      srLiiData = list[0];
    }
    return Container(
      width: ScreenHelper.screenWidth,
      alignment: Alignment.center,
      padding: EdgeInsets.symmetric(horizontal: ScreenHelper.width(15)),
      margin: EdgeInsets.symmetric(horizontal: ScreenHelper.width(15)),
      color: Colors.white,
      child: Column(
        children: [
          Container(
            margin: EdgeInsets.symmetric(vertical: 6),
            child: textItemWidget(
                attrName: '体重',
                value: '${srLiiData!.value!} kg',
                fontSize: 16,
                valuColor: AppTheme.dartTextColor),
          ),
          Container(
            margin: EdgeInsets.symmetric(vertical: 6),
            child: textItemWidget(
                attrName: '评估',
                value: '${srLiiData.evaluate}',
                fontSize: 16,
                valuColor: AppTheme.dartTextColor),
          ),
          btnComponent(onPressed: () {}, textStr: '添加数据')
        ],
      ),
    );
  }
}
